package com.hrm.dao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

/** 数据库操作接口,实现执行或者查询
 * Create by zekdot on 19-6-15.
 */
public interface DaoOp<T> {

    /**
     * 执行数据库执行动作
     * @param connection 连接
     *
     */
    public void execute(Connection connection) throws Exception;

    /**
     * 查询多条
     * @param connection 连接
     *
     * @return
     */
    public List<T> queryList(Connection connection) throws Exception;

    /**
     * 查询一条
     * @param connection
     * @return
     * @throws SQLException
     */
    public T queryOne(Connection connection) throws Exception;
}
